//13. 罗马数字转整数(字符串 简单)
int romanToInt(char* s) 
{
    int sum=0;
    for(int i=0;i<strlen(s);i++)
    {   
        if (s[i]=='M')
            sum+=1000;
            
        if (s[i]=='D')
            sum+=500;

        if (s[i]=='C')
        {sum+=100;    
            if (s[i+1]=='D'||(s[i+1]=='M'))
                sum-=200;
        }

        if (s[i]=='L')
            sum+=50;

        if (s[i]=='X')
        {sum+=10;    
            if (s[i+1]=='L'||(s[i+1]=='C'))
                sum-=20;
        }

        if (s[i]=='V')
            sum+=5;

        if (s[i]=='I')
        {  sum+=1;
            if (s[i+1]=='V' ||(s[i+1]=='X'))
                sum-=2;
        }
    } 
return sum;  
}